package com.lixh.sdk.base.util

import com.tencent.mmkv.MMKV

private val kv: MMKV = MMKV.defaultMMKV()

infix fun String.saveString(value: String?) = kv.encode(this, value)
infix fun String.getString(defaultValue: String?): String =
    kv.decodeString(this, defaultValue) ?: ""

// key saveInt value
infix fun String.saveInt(value: Int) = kv.encode(this, value)
infix fun String.getInt(defaultValue: Int) = kv.decodeInt(this, defaultValue)